﻿using System.Windows;
using MetroJabb.Properties;
using MetroJabbViewModel;

namespace MetroJabb
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            DataContext = new ChatViewModel(
                Settings.Default.ChatServerUrl, 
                Settings.Default.ChatHubName, 
                SettingsUserDataStore.Instance);
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var model = (ChatViewModel)DataContext;
            model.SendMessageCommand.Execute(TypingBox.Text);

            TypingBox.Clear();
            TypingBox.Focus();
        }
    }
}